<?php
require_once("PHPMySQLiDatabaseClass/MysqliDb.php");
require_once("db_config.php");
$account = $_POST["account"];
$db_config = new dbConfig();
$db = new MysqliDb
(
    $db_config->host,
    $db_config->account,
    $db_config->pwd,
    'student'
);
$task_name = $_POST['task_name'];
#echo "传入".$task_name;
#SELECT id FROM `collect` WHERE task_name = $task_name
$db->where("task_name",$task_name);
$result = $db->getValue("collect","id");
#echo $result;
#DELETE FROM `collect` WHERE `collect`.`id` = 7
$db->where("id",$result);
$final =$db->delete("collect");
if($final)
{
    echo 'successfully deleted';
}
else
{
   echo '错误'.$db->getLastError();
}
?>